#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：python_learning 
@File ：handle_exceptions.py
@IDE  ：PyCharm 
@Author ：李涵彬
@Date ：2024/6/3 下午5:06 
"""

from functools import wraps


def handle_exceptions(func):
	@wraps(func)
	def wrapper(*args, **kwargs):
		try:
			return func(*args, **kwargs)
		except Exception as e:
			print(f'Error in {func.__name__}: {e}')
			error_message = f'Error in {func.__name__}: {e}'
			return error_message

	return wrapper
